
<template>

  <div>    
    <Row>
        <Col span="4"><h1>经销商列表</h1></Col>
        <Col span="13"><Button type="primary" size="large" @click="exportData"><Icon type="ios-download-outline"></Icon>导出表格数据</Button></Col> 
        <Col span="1"><Button type="primary" size="large" @click="totalClick">全部</Button></Col>
        <Col span="6">
            <Input v-model="search">
                <Select v-model="select2" slot="prepend" style="width: 80px">
                    <Option value="name">姓名</Option>
                    <Option value="p_num">手机号</Option>
                    <Option value="c_num">身份证</Option>
                    <Option value="uid">编号</Option>
                </Select>
                <Button slot="append" icon="ios-search" @click="findOne"></Button>
            </Input>
        </Col>   
    </Row>  
    <Table :columns="columns1" :data="data1" ref=table></Table>
    <div style="margin: 10px;overflow: hidden">
        <div style="float: right;">
            <Page :total="dataCount" :page-size="pageSize" show-total @on-change="changePage"></Page>
        </div>
    </div>
    <h1>经销商详情</h1>
    <Row>
        <Col span="12">
            <Row type="flex" justify="space-around">
                <Col span="3"><span @click="cost"><Button>消费返佣</Button></span></Col>
                <Col span="3"><span @click="business"><Button>招商返佣</Button></span></Col>
            </Row>
            <Row>
                <Table height="150" :columns="columns2" :data="data2"></Table>
            </Row>
        </Col>
        <Col span="12">
            <Row>
                <H2 align="center">提现记录</H2>
                <Table height="130" :columns="columns3" :data="data3"></Table>
            </Row>
            <Row>
                <Col span="12"><H2>可提现余额</H2></Col>
                <Col span="12"><H2 v-model="total">{{ total }}</H2></Col>
            </Row>
        </Col>
    </Row>
    <Row>
        <Col span="12">
            <Row>
                <Col span="6"><H2>审核通过时间:</H2></Col>
                <Col span="18"><H2 v-model="auditing_time">{{ auditing_time }}</H2></Col>
            </Row>                
            <Row>
                <Col span="8"><H2>直属介绍人:</H2></Col>
                <Col span="12"><H2 v-model="higherUp">{{ higherUp }}</H2></Col>
            </Row>
            <Row>
                <Col span="8"><H2>当月消费总额:</H2></Col>
                <Col span="12"><H2 v-model="costNum">{{ costNum }}</H2></Col>
            </Row>
            <Row>
                <Col span="8"><H2>当月招商总额:</H2></Col>
                <Col span="12"><H2 v-model="businessNum">{{ businessNum }}</H2></Col>
            </Row>
        </Col>
        <Col span="12">
            <Row>
                <Col span="10"><H2>邀请好友人数:</H2></Col>
                <Col span="14"><H2 v-model="count">{{ count }}</H2></Col>
            </Row>
            <Row>
                <Table height="130" :columns="columns4" :data="data4"></Table>
            </Row>
        </Col>
    </Row>
    <Modal
        v-model="modal1"
        title="购买服务"
        @on-ok="ok">
        <Select
            v-model="select1"
            filterable>
            <Option v-for="option in server" :value="option.value" :key="option.value">{{option.label}}</Option> 
        </Select>
        <Input v-model="num" placeholder="输入数量"/>
        <Input v-model="price" placeholder="输入价格"/>
    </Modal> 
    <Modal
        v-model="modal2"
        title="顾客消费"
        @on-ok="ok">
        <Select
            v-model="select1"
            filterable>
            <Option v-for="option in server" :value="option.value" :key="option.value">{{option.label}}</Option> 
        </Select>
        <Input v-model="num" placeholder="输入数量"/>        
        <Input v-model="des" placeholder="顾客姓名"/>
        <Input v-model="price" placeholder="输入价格"/>
    </Modal>
    <Modal
        v-model="modal3"
        title="级别调整"
        @on-ok="ok1">
        <Select
            v-model="select1"
            filterable>
            <Option v-for="option in server1" :value="option.value" :key="option.value">{{option.label}}</Option> 
        </Select>
    </Modal>
    <Modal
        v-model="modal4"
        title="选择上级"
        @on-ok="ok2">
        <Select
            v-model="select1"
            filterable>
            <Option v-for="option in server2" :value="option.value" :key="option.value">{{option.label}}</Option> 
        </Select>
        <Input v-model="p_num" placeholder="手机号"/>        
        <Input v-model="c_num" placeholder="身份证号"/>
    </Modal>         
  </div> 

</template>
<script>
export default {
    data() {
        return {
            modal1:false,
            modal2:false,
            modal3:false,
            modal4:false,
            select1:0,
            select2:"name",
            num:'',
            uid:'',
            uid1:'',
            total:'',
            auditing_time:'',
            higherUp:'',
            count:'',
            price:'',
            des:'',
            type:'',
            dataCount:0,
            pageSize:6,
            search:'',
            costNum:0,
            businessNum:0,
            p_num:0,
            c_num:0,
            historyDate:[],
            server:[],
            server1:[],
            server2:[],
            columns1: [
                {
                    title: "真实姓名",
                    key: "name",
                    width:120,
                    fixed: 'left'
                },
                {
                    title: "编号",
                    key: "uid",
                    width:120
                },
                {
                    title: "级别",
                    key: "level",
                    render:(h,params)=>{
                        return h('div',function(){
                            switch(parseInt(params.row.level)){
                                case 1:
                                return "联合创始人";
                                case 2:
                                return "执行董事";
                                case 3:
                                return "合伙人";
                                case 4:
                                return "钻石代理";
                            }
                        }())
                    },
                    width:100
                },   
                {
                    title: "手机号码",
                    key: "p_num",
                    width:120
                },
                {
                    title: "通讯地址",
                    key: "address",
                    width:200
                },
                {
                    title: "身份证号码",
                    key: "c_num",
                    width:200
                },
                {
                    title: "年龄",
                    key: "age",
                    width:80,
                    sortable: true
                },
                {
                    title: "开户银行",
                    key: "bank",
                    width:160
                },
                {
                    title: "银行号码",
                    key: "b_num",
                    width:200
                },
                {
                    title: "性别",
                    key: "sex",
                    render:(h,params)=>{
                        return h('div',function(){
                            switch(params.row.sex){
                                case 0:
                                return "女";
                                case 1:
                                return "男";
                            }
                        }())
                    },
                    width:65
                },
                {
                    title: "已消费的服务",
                    key: "consumerService",
                    width: 1200,
                    render: (h, params) => {
                        return h('div', {
                            attrs: {
                                style:'float:left;width:1920px;height: 40px;'
                            },
                        }, 
                        this.addService(h,params.row.consumerService)
                    )}
                }, 
                {
                    title: "剩余服务内容",
                    key: "residualService",
                    width: 1200,
                    render: (h, params) => {
                        return h('div', {
                            attrs: {
                                style:'float:left;width:1920px;height: 40px;'
                            },
                        }, 
                        this.addService(h,params.row.residualService)
                    )}
                },
                {
                    title: "转移服务内容",
                    key: "givenService",
                    width: 1200,
                    render: (h, params) => {
                        return h('div', {
                            attrs: {
                                style:'float:left;width:1920px;height: 40px;'
                            },
                        }, 
                        this.addService(h,params.row.givenService)
                    )}
                },                  
                {
                    title: "操作",
                    key: "action",
                    width: 400,
                    align: "center",
                    fixed: 'right',
                    render: (h, params) => {
                        return h("div", [
                            h(
                                "Button",
                                {
                                    props: {
                                        type: "primary",
                                        size: "small"
                                    },
                                    style: {
                                        marginRight: "2px"
                                    },
                                    on: {
                                        click: () => {
                                            this.update(params.row.uid, 0);
                                        }
                                    }
                                },
                                "个人消费"
                            ),
                            h(
                                "Button",
                                {
                                    props: {
                                        type: "primary",
                                        size: "small"
                                    },
                                    style: {
                                        marginRight: "2px"
                                    },
                                    on: {
                                        click: () => {
                                            this.update(params.row.uid, 1);
                                        }
                                    }
                                },
                                "顾客消费"
                            ),
                            h(
                                "Button",
                                {
                                    props: {
                                        type: "error",
                                        size: "small"
                                    },
                                    style: {
                                        marginRight: "2px"
                                    },
                                    on: {
                                        click: () => {
                                            this.remove(params.index);
                                        }
                                    }
                                },
                                "删除"
                            ),
                            h(
                                "Button",
                                {
                                    props: {
                                        type: "primary",
                                        size: "small"
                                    },
                                    style: {
                                        marginRight: "2px"
                                    },
                                    on: {
                                        click: () => {
                                            this.updateMessage(params.index);
                                        }
                                    }
                                },
                                "修改信息"
                            ),
                            h(
                                "Button",
                                {
                                    props: {
                                        type: "primary",
                                        size: "small"
                                    },
                                    style: {
                                        marginRight: "2px"
                                    },
                                    on: {
                                        click: () => {
                                            this.updateLevel(params.index);
                                        }
                                    }
                                },
                                "级别调整"
                            ),
                            h(
                                "Button",
                                {
                                    props: {
                                        type: "primary",
                                        size: "small"
                                    },
                                    on: {
                                        click: () => {
                                            this.show(params.index);
                                        }
                                    }
                                },
                                "详情"
                            )
                        ]);
                    }
                }
            ],
            columns2:[
                {
                    title: "时间",
                    key: "create_time",
                    render:(h,params)=>{
                        return h('div', function(){
                            let n = Date.parse(params.row.create_time);
                            let date = new Date();
                            date.setTime(n);
                            return date.toLocaleString();
                        }())
                    }
                    
                },
                {
                    title: "金额",
                    key: "price"
                },
                {
                    title: "描述",
                    key: "des"
                },
            ],
            columns3:[
                {
                    title: "提现时间",
                    key: "auditing_time",
                    render:(h,params)=>{
                        return h('div', function(){
                            let n = Date.parse(params.row.auditing_time);
                            let date = new Date();
                            date.setTime(n);
                            return date.toLocaleString();
                        }())
                    }
                },
                {
                    title: "提现金额",
                    key: "price"
                },
            ],
            columns4:[
                {
                    title: "加入时间",
                    key: "auditing_time",
                    render:(h,params)=>{
                        return h('div', function(){
                            let n = Date.parse(params.row.auditing_time);
                            let date = new Date();
                            date.setTime(n);
                            return date.toLocaleString();
                        }())
                    }
                },
                {
                    title: "级别",
                    key: "level",
                    render:(h,params)=>{
                        return h('div',function(){
                            switch(parseInt(params.row.level)){
                                case 1:
                                return "联合创始人";
                                case 2:
                                return "执行董事";
                                case 3:
                                return "合伙人";
                                case 4:
                                return "钻石代理";
                            }
                        }())
                    }
                },
                {
                    title: "姓名",
                    key: "name"
                },
            ],
            data1: [
               
            ],
            data2: [

            ],
            data3: [

            ],
            data4: [

            ],
        };
    },
    mounted() {        
        let mid = localStorage.getItem("mid");
        if (mid == 'undefined' || mid == ''){
            alert("您还没有登陆");
            this.$router.push("admin");
            return;
        }
        if (mid.indexOf('1') < 0){
            alert("您没有权限");
            return;
        }     
        this.myShow();   
        this.addOption();    
    },
    methods: {
        totalClick(){
            this.myShow();
        },
        addService(h, service){
            let length = service.length;
            let server = [];
            for (let i = 0; i < length; i++){           
                server.push(h('div',{
                    style:{float:'left',width:'150px',height:'40px'}
                },
                [h('img', {
                    props: {
                        type: 'primary',
                        size: 'small'
                    },
                    attrs: {
                        src: service[i].icon_url, style: 'width: 40px;height: 40px;border-radius: 2px;'
                    },
                    style: {
                        float:"left"
                    }
                }),   
                h('p', {
                    attrs: {                                   
                        style:'float:left;margin-top:20px;width:110px;height:40px;' 
                        },                                
                    }, service[i].name + "x" + service[i].num)]                            
                ));                    
            }
            return server;
        },
        myShow(){
            let qs = require('qs');
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getAllUsers`,
                data: qs.stringify({})
                }).then(response => {
                    if ((response.data.result == 200)) {                                                
                        this.historyDate = response.data.data;
                        this.dataCount = this.historyDate.length;
                        if (this.historyDate.length <= this.pageSize){
                            this.data1 = this.historyDate;
                        }else{
                            this.data1 = this.historyDate.slice(0, this.pageSize);
                        }
                        //this.data1 = response.data.data;
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            }); 
        },
        addOption(){
            let qs = require('qs');
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getAllService`,
                data: qs.stringify({})
                }).then(response => {
                    if ((response.data.result == 200)) {
                        let length = response.data.data.length;
                        let harray = [];
                        for (let i = 0; i < length; i++){
                            harray.push(
                                {value:response.data.data[i].id, label:response.data.data[i].name}
                            );
                        }
                        this.server = harray;
                        this.select1 = harray[0].value;
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
        },
        update(uid, type) {
            switch(type){
                case 0:
                    this.modal1=true;
                break;
                case 1:
                    this.modal2=true;
                break;
            }           
            this.uid = uid;      
            this.type = type;                     
        },
        ok(){
            let qs = require('qs');
            switch(this.type){
                case 0:
                    this.axios({
                        method: "post",
                        url: `${this.adminUrl}/updateService`,
                        data: qs.stringify(
                            {
                                uid:this.uid,
                                aid:localStorage.getItem("aid"),
                                sid:this.select1,
                                num:this.num,
                                price:this.price
                            }
                            )
                        }).then(response => {
                            if ((response.data.result == 200)) {
                                this.myShow();
                                alert("添加成功");
                            }else{
                                alert("请求失败");
                            }
                        }).catch(err =>{
                            console.log(err);
                    });
                break;
                case 1:
                    this.axios({
                        method: "post",
                        url: `${this.adminUrl}/costService`,
                        data: qs.stringify(
                            {
                                uid:this.uid,
                                aid:localStorage.getItem("aid"),
                                sid:this.select1,
                                num:this.num,
                                des:this.des,
                                price:this.price
                            }
                            )
                        }).then(response => {
                            if ((response.data.result == 200)) {
                                alert("添加成功");
                            }else{
                                alert("请求失败");
                            }
                        }).catch(err =>{
                            console.log(err);
                    });
                break;
            }
            
        },
        show(index) {
            this.uid1 = `${this.data1[index].uid}`;
            this.auditing_time = `${this.data1[index].auditing_time}`;
            this.auditing_time = Date.parse(this.auditing_time);
            let date = new Date();
            date.setTime(this.auditing_time);
            this.auditing_time = date.toLocaleString();

            let qs = require('qs');
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getCostIncomeByOne`,
                data: qs.stringify(
                    {uid:`${this.data1[index].uid}`, status:0}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        //this.data1.splice(index, 1);
                        this.data2 = response.data.data;
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            }); 
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getUserMessage`,
                data: qs.stringify(
                    {uid:`${this.data1[index].higher_up}`}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        if (response.data.data.length == 0) {
                            this.higherUp = '';
                        }else{
                            this.higherUp = response.data.data[0].name + " " + response.data.data[0].p_num;
                        }                        
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getTotalOrderByMonth`,
                data: qs.stringify(
                    {type:0, uid:`${this.data1[index].uid}`}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        this.costNum = response.data.data[0].price==null?0:response.data.data[0].price;                        
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            }); 
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getTotalOrderByMonth`,
                data: qs.stringify(
                    {type:1, uid:`${this.data1[index].uid}`}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        this.businessNum = response.data.data[0].price==null?0:response.data.data[0].price;                        
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });                         
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getSuccessCashedByOne`,
                data: qs.stringify(
                    {id:'uid', value:`${this.data1[index].uid}`}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        //this.data1.splice(index, 1);
                        this.data3 = response.data.data;
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getWallet`,
                data: qs.stringify(
                    {uid:`${this.data1[index].uid}`, status:0}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        //this.data1.splice(index, 1);
                        this.total = response.data.data.total + "元";
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getDowner`,
                data: qs.stringify(
                    {uid:`${this.data1[index].uid}`, status:0}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        //this.data1.splice(index, 1);
                        this.data4 = response.data.data;
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getDownerNum`,
                data: qs.stringify(
                    {uid:`${this.data1[index].uid}`, status:0}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        //this.data1.splice(index, 1);
                        this.count = response.data.data.num;
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
        },
        remove(index) {
            let qs = require('qs');
            this.axios({
                method: "post",
                url: `${this.adminUrl}/deleteUser`,
                data: qs.stringify(
                    {uid:`${this.data1[index].uid}`, status:1}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        this.data1.splice(index, 1);
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
        },
        cost(){
            let qs = require('qs');
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getCostIncomeByOne`,
                data: qs.stringify(
                    {uid:this.uid1, status:0}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        //this.data1.splice(index, 1);
                        this.data2 = response.data.data;
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
        },
        business(){
            let qs = require('qs');
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getBusinessIncomeByOne`,
                data: qs.stringify(
                    {uid:this.uid1, status:0}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        //this.data1.splice(index, 1);
                        this.data2 = response.data.data;
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
        },
        exportData(){
            this.$refs.table.exportCsv({
                filename: '经销商数据',
                columns:this.columns1,
                data: this.getExcel()            
            });
        },
        getExcel(){
            let data = [];
            for (let i = 0; i < this.historyDate.length; i++) {
                let json = {};
                json["name"] = this.historyDate[i].name;
                json["p_num"] = this.historyDate[i].p_num= '="'+this.historyDate[i].p_num+'"';
                json["c_num"] = this.historyDate[i].c_num= '="'+this.historyDate[i].c_num+'"';
                json["age"] = this.historyDate[i].age;
                json["bank"] = this.historyDate[i].bank;
                json["b_num"] = this.historyDate[i].b_num= '="'+this.historyDate[i].b_num+'"';
                json["sex"] = this.historyDate[i].sex==0?'女':'男';
                json["level"] = this.historyDate[i].level > 1?(this.historyDate[i].level > 2? (this.historyDate[i].level > 3?'钻石代理':'合伙人'):'执行董事'):'联合创始人';
                json["address"] = this.historyDate[i].address;
                let consumer = '';               
                for (let j = 0; j < this.historyDate[i]["consumerService"].length; j++) {                   
                    consumer += this.historyDate[i]["consumerService"][j].name + "x" + this.historyDate[i]["consumerService"][j].num;
                    consumer += "  ";
                }               
                json["consumerService"] = consumer;

                let residual = '';
                for (let j = 0; j < this.historyDate[i]["residualService"].length; j++) {
                    residual += this.historyDate[i]["residualService"][j].name + "x" + this.historyDate[i]["residualService"][j].num;
                    residual += "  ";
                }
                json["residualService"] = residual;

                let given = '';
                for (let j = 0; j < this.historyDate[i]["givenService"].length; j++) {                    
                    given += this.historyDate[i]["givenService"][j].name + "x" + this.historyDate[i]["givenService"][j].num;
                    given += "  ";
                }
                json["givenService"] = given;

                data.push(json);
            }
            return data;
        },
        changePage(index){
            let start = (index - 1) * this.pageSize;
            let end = index * this.pageSize;
            this.data1 = this.historyDate.slice(start, end);
        },
        findOne(){
            let data = {};
            switch(this.select2){
                case "name":
                    data["id"] = "name";                   
                break;
                case "p_num":
                    data["id"] = "p_num";
                break;
                case "c_num":
                    data["id"] = "c_num";
                break;
                case "uid":
                    data["id"] = "uid";
                break;
            }
            data["value"] = this.search;
            let qs = require('qs');
            this.axios({
                method: "post",
                url: `${this.adminUrl}/getAllUsersByOne`,
                data: qs.stringify(
                    {id:data["id"], value:data["value"]}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        this.historyDate = response.data.data;
                        this.dataCount = this.historyDate.length;
                        if (this.historyDate.length <= this.pageSize){
                            this.data1 = this.historyDate;
                        }else{
                            this.data1 = this.historyDate.slice(0, this.pageSize);
                        }
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
        },
        updateLevel(index){           
            this.modal3 = true;
            this.uid = this.data1[index].uid;
            this.server1 = [];
            if (this.data1[index].level.toString() != '4'){
                this.server1.push({value:4, label:'钻石代理'});
            }
            if (this.data1[index].level.toString() != '3'){
                this.server1.push({value:3, label:'合伙人'});
            }
            if (this.data1[index].level.toString() != '2'){
                this.server1.push({value:2, label:'执行董事'});
            }
            if (this.data1[index].level.toString() != '1'){
                this.server1.push({value:1, label:'联合创始人'}); 
            }                     
        },
        updateMessage(index){
            this.modal4 = true;
            this.uid = this.data1[index].uid;
            let select = 0;
            let harray = [];
            for (let i = 0; i < this.historyDate.length; i++){
                harray.push(
                    {value:this.historyDate[i].uid, label:this.historyDate[i].name + "(" + this.historyDate[i].p_num + ")"}
                );
                
                if (harray[i].value == this.historyDate[index].higher_up){
                    select = i;
                }
            }
            this.server2 = harray;
            this.select1 = harray[select].value;            
            this.p_num = this.data1[index].p_num;
            this.c_num = this.data1[index].c_num;
        },
        ok1(){
            let qs = require('qs');
            this.axios({
                method: "post",
                url: `${this.adminUrl}/updateLevel`,
                data: qs.stringify(
                    {level:this.select1, uid:this.uid, aid:localStorage.getItem("aid")}
                    )
                }).then(response => {
                    if ((response.data.result == 200)) {
                        this.myShow();
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
        },
        ok2(){
            let qs = require('qs');
            this.axios({
                method: "patch",
                url: `${this.adminUrl}/updateMessage`,
                data: qs.stringify({uid:this.uid, higher_up:this.select1, p_num:this.p_num, c_num:this.c_num, aid:localStorage.getItem("aid")})
                }).then(response => {
                    alert(response.status); 
                    if ((response.data.result == 200)) {                                             
                        this.myShow();
                    }else{
                        alert("请求失败");
                    }
                }).catch(err =>{
                    console.log(err);
            });
        }              
    }
};
</script>

   



<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.center{
    position: absolute;
    margin: 0 auto;
    align-self: center;
    top: 20%;
    left: 15%;
    z-index: 1;
}

</style>
